import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

import path from "path";

export default defineConfig({
  plugins: [vue()],
  css: {
    preprocessorOptions: {
      scss: {},
    },
  },
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"), // 设置 @ 别名指向 src 目录
      "~": path.resolve(__dirname, "public"),
    },
  },
  server: {
    port: 8080,
    // proxy: {
    //   "/web_transport": {
    //     target: "http://127.0.0.1:3000",
    //     changeOrigin: true,
    //     secure: false,
    //     agent: new Agent({ keepAlive: true, keepAliveMsecs: 20000 }),
    //     rewrite: (path) => path.replace(/^\/web_transport/, "/"),
    //   },
    // },
  },
});
